import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

//权限系统
const login = r => require.ensure([], () => r(require('@/pages/login')), 'login');
const home = r => require.ensure([], () => r(require('@/pages/home')), 'home');
const table = r => require.ensure([], () => r(require('@/pages/table')), 'table');
const addAdmin = r => require.ensure([], () => r(require('@/pages/addAdmin')), 'addAdmin');

//范掌柜官网
//const fanzhangguiWeb = r => require.ensure([], () => r(require('@/pages/fan/fanzhangguiWeb')), 'fanzhangguiWeb');
//const counterMsg = r => require.ensure([], () => r(require('@/pages/fan/counterMsg')), 'counterMsg');
//const test = r => require.ensure([], () => r(require('@/pages/fan/test')), 'test');

const routes = [
  {
    path: '/',
    component: login,
    name:"login"
  },{
    path: '/home',
    component: home,
    name: '',
    children: [{
      path: '/table',
      component: table,
      // meta: ['添加数据', '添加商铺'],
    },{
      path: '/addAdmin',
      component: addAdmin,
      // meta: ['添加数据', '添加商铺'],
    }]
	}
]

export default new Router({
  routes,
})
